package com.mike.server.engine;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.log4j.Logger;

import com.mike.server.support.BaseEngine;

/**
 * 游戏引擎的事件分发线程池
 * @author <a href="zhaoming23@gmail.com"> Mike </a>
 * @version 1.0
 * 2011-4-4 下午05:02:02
 */
public class GameEngine extends BaseEngine {

	public static final int GAME_ENGINE_THREAD_POOL = 1;
	
	private static ExecutorService engineService = Executors.newFixedThreadPool(GAME_ENGINE_THREAD_POOL);
	
	private static final Logger LOG = Logger.getLogger(GameEngine.class);
	
	private static GameEngine instance = new GameEngine();
	
	private GameEngine() {
		//Don't allow new it outside.
	}
	
	public static GameEngine getInstance() {
		return instance;
	}

	@Override
	public void start() {
		engineService.execute(ServiceDispatherThread.getInstance());
		LOG.info("游戏引擎启动...");
	}
	
	
	                                        
}
